//
//  SongInfoCell.swift
//  SwiftBase
//
//  Created by rubick on 2023/2/14.
//

import Foundation
import UIKit
import SnapKit

class SongInfoCell: UITableViewCell {
    var songImageV: UIImageView?
    var songTitleLab: UILabel?
    var songArtistLab: UILabel?
    //
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupChildren()
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func setupChildren() {
        contentView.backgroundColor = .white
        //
        songImageV = UIImageView(frame: CGRect(x: 15, y: 10, width: 95, height: 95))
        songImageV!.layer.cornerRadius = 5
        self.contentView.addSubview(songImageV!)
        //
        songTitleLab = UILabel(frame: CGRect(x: 120, y: 10, width: rk_screenWidth - 145, height: 55))
        songTitleLab!.numberOfLines = 3
        songTitleLab!.font = UIFont.systemFont(ofSize: 15)
        songTitleLab!.textColor = .darkText
        self.contentView.addSubview(songTitleLab!)
        //
        songArtistLab = UILabel(frame: CGRect(x: 120, y: 70, width: rk_screenWidth - 145, height: 30))
        songArtistLab?.numberOfLines = 2
        songArtistLab!.font = UIFont.systemFont(ofSize: 14)
        songArtistLab!.textColor = .darkText
        self.contentView.addSubview(songArtistLab!)
    }
}
